﻿<!doctype html>
 <html >
 <head>
   <meta charset="UTF-8">
   <link rel="stylesheet" href="${req.contextPath}/css/common.css">
   <link rel="stylesheet" href="${req.contextPath}/css/main.css">
   <script type="text/javascript" src="${req.contextPath}/js/jquery.min.js"></script>
   <script type="text/javascript" src="${req.contextPath}/js/colResizable-1.3.min.js"></script>
   <script type="text/javascript" src="${req.contextPath}/js/common.js"></script>
</head>

<body>
  <div id="forms" class="mt10">
        <div class="box">
          <div class="box_border">
            <div class="box_top"><b class="pl15">名片印制流程</b></div>
            <div class="box_center">
              <form id="form" action="list.ftl" class="jqtransform">
               <table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
                   <tr>
                      <td class="td_right">姓名：</td>
                      <td class="">
                          ${user.realName}
                          <input name="realName" type="hidden" readonly value="${user.realName}">
                      </td>
				  </tr>
				  <tr>
                      <td class="td_right">申请时间：</td>
                      <td>
                          <input type="date" name="applyTime" readonly value="${dated?date}" class="input-text lh30" size="40">
                      </td>
                  </tr>
				  <tr>
                      <td class="td_right">部门：</td>
                        <td>
                            <#if user.deptId == dept.deptId >
                                ${dept.deptName}
                                <input name="deptId" type="hidden" value="${dept.deptId}">
                            </#if>
                        </td>
                  </tr>
				  <tr>
                      <td class="td_right">职务：</td>
                      <td>
                          <#if user.classsifyId == classsify.classsifyId >
                              ${classsify.classsifyName}
                              <input name="classsifyId" type="hidden" value="${classsify.classsifyId}">
                          </#if>
                      </td>
                  </tr>
				  <tr>
                      <td class="td_right">手机号：</td>
                      <td><input type="text" id="phone" name="phone" class="input-text lh30" size="40"></td>
                  </tr>
				
                  <tr>
                      <td class="td_right">数量：</td>
                      <td><input type="text" id="number" name="number" class="input-text lh30" size="40"></td>
                  </tr>
                  <tr>
                      <td class="td_right">备注：</td>
                      <td><textarea name="content" placeholder="选填" class="input-text lh30"></textarea></td>
                  </tr>
				
				  <tr>
                      <td class="td_right">下一步审批人：</td>
                      <td>
                          <select class="input-text lh30" name="postId"  >
                               <option value="">请选择</option>
                               <option value="2">行政主管</option>
                          </select>
                      </td>
                  </tr>
                  <tr>
                      <td class="td_right">&nbsp;</td>
                      <td class="">
                          <input type="button" onclick="sub()" name="button" class="btn btn82 btn_save2" value="确定">
                          <input type="button" name="button" class="btn btn82 btn_res" onclick="location.href='javascript:history.go(-1)'" value="返回">
                      </td>
                  </tr>
               </table>
               </form>
            </div>
          </div>
        </div>
     </div>
   </div> 
</body>
<script type="text/javascript" src="${req.contextPath}/js/jquery.min.js"></script>
<script>
    function sub() {
        //序列化表单数据
        var formData = $("#form").serialize();
        var phone = $("#phone").val();
        var number = $("#number").val();
        //校验手机号
        if(!(/^1[3|4|5|7|8|9][0-9]\d{8}$/.test(phone))) {
            alert("手机号不合法")
            return;
        }
        //校验数量是否为数字
        if (number==""||isNaN(number)||number<1){
            alert("打印数量必须填为正整数");
            return;
        }
        //保存请求数据
        $.post(
            "${req.contextPath}/administrative/card",
            formData,
            function (result) {
                if (result.code==0){
                    alert("申请成功");
                    location.href="${req.contextPath}/administrative/success";
                }else {
                    alert(result.msg)
                }
            },
            "json"
        );
    }



</script>

</html>